//
// Created by hsj on 2022/2/24.
//
#include <string>
#include <cstring>
#include <iostream>

#ifndef CLION_CPP_T_UTILS_H
#define CLION_CPP_T_UTILS_H
namespace t_utils_test{
    using std::cout;
    using std::cin;
    using std::endl;

    class T{
        private:
            //非堆内存分配
            char numStr[128]{0};
        public:
            T(){
                cout<<"create T instance."<<endl;
            }
            virtual ~T(){
                cout<<"delete T instance."<<endl;
            }
            /**
             * int transform string
             * @return
             */
            const char * int2str(int intValue = 0){
                sprintf(numStr, "%d", intValue);
                return numStr;
            }
            /**
             * float transform string
             * @return
             */
            const char * float2str(float floatValue = 0.0f){
                sprintf(numStr, "%f", floatValue);
                return numStr;
            }
            /**
             * double transform string
             * @return
             */
            const char * double2str(double doubleValue = 0.0f){
                sprintf(numStr, "%lf", doubleValue);
                return numStr;
            }
    };
}
#endif //CLION_CPP_T_UTILS_H
